package com.qf.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Set;

@Data
@Accessors(chain = true)
public class User implements Serializable{
  @TableId(type = IdType.AUTO)
  private Integer id;
  private String username;
  private String password;
  private String nickname;
  private String email;
  private String phone;
  @DateTimeFormat(pattern = "yyyy-MM-dd")
  private Date createTime = new Date();
  private int status;
  @Field(type = FieldType.Nested)
  @TableField(exist = false)
  private List<Collect> collects;
}
